<html>
<head>
     <title>Help: scalprod</title>
</head>
<body>
     <center><table><tbody>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd;">
                  <h4>scalprod</h4>Cross or dot product of two 3D scalar fields
                  <br><small>Last modified: 25-Sep-2009 16:28:41</small>

          </tr>
          <tr>
             <td style="border: 0px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd;">
                  <a href="http://guillaumemaze.googlecode.com/svn/trunk/matlab/codes/geophysic/scalprod.m">Download here</a>
             </td>
          </tr>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #fff; font-size:12px;">
                  <br>% scalprod Cross or dot product of two 3D scalar fields<br>%<br>% [a1,a2,a3] = scalprod(DZ,DY,DX,A,B,WPROD)<br>% <br>% Compute either the cross or dot products of the two<br>% scalar fields A and B.<br>% A and B are of dimensions: (NZ,NY,NX)<br>% DX,DY,DZ are distances between A,B grid points<br>% 	DX: DX(NZ,NY,NX-1)<br>% 	DY: DY(NZ,NY-1,NX)<br>% 	DZ: DZ(NZ-1,NY,NX)<br>%<br>% WPROD is 1 or 'x' for the cross product<br>% then:<br>% 	Jx =   d(A)/dy.*d(B)/dz - d(A)/dz.*d(B)/dy;<br>% 	Jy = -(d(A)/dx.*d(B)/dz - d(A)/dz.*d(B)/dx);<br>% 	Jz =   d(A)/dx.*d(B)/dy - d(A)/dy.*d(B)/dx;<br>%<br>% WPROD is 2 or '.' for the dot product<br>% then:<br>% 	Jx =   d(A)/dx.*d(B)/dx<br>% 	Jy =   d(A)/dy.*d(B)/dy<br>% 	Jz =   d(A)/dz.*d(B)/dz<br>%<br>% Vector components a1,a2 and a3 are given back on the <br>% same grid as A and B.<br>% Outputs depend on the number of fields asked and on WPROD:<br>% For WPROD a CROSS PRODUCT:<br>% 	a1 only		: a1=Jz, ie the curl<br>% 	a1,a2 only	: a1=Jy, a2=Jx<br>% 	a1,a2,a3	: a1=Jz, a2=Jy, a3=Jx<br>% For WPROD a DOT PRODUCT:<br>% 	a1 only		: a1=Jx+Jy+Jz<br>% 	a1,a2 only	: a1=Jy, a2=Jx<br>% 	a1,a2,a3	: a1=Jz, a2=Jy, a3=Jx<br>%<br>% Created: 2008-12-14.
             </td>
          </tr>
          <tr>
             <td style="border: 1px solid rgb(170, 170, 170); padding: 5px; background-color: #ddd; font-size:12px;">
                  Last update: 2011 March 04, 17:46<br>
                  Created by Guillaume Maze<br>
                  More informations at: <a href="http://codes.guillaumemaze.org/matlab">codes.guillaumemaze.org/matlab</a><br>
             </td>
          </tr>
     </tbody></table></center>
</body>
</html>
